home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / share / Dos / VARIOS / pascal / SWAG9605.DDD / 0148_Compile all units in DIR.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-05-31  |  712 b   |  30 lines

  1. {$a+,x-,n-,e-,q-,r-,s-,v-,t-,d-}
  2. uses dos,exec;  { see EXEC.SWG for HEAPMAN to do EXECUTE }
  3.  
  4. var
  5.   info:searchrec;
  6.   paspth:string;
  7.   de,de2:word;
  8.  
  9. begin
  10.   writeln('Compiling all pascal files.');
  11.   paspth:=fsearch('BPC.EXE',getenv('PATH'));
  12.   if(paspth='')then
  13.   begin
  14.     writeln('Couldn''t find pascal compiler.');
  15.     halt(1);
  16.   end;
  17.   findfirst('*.pas',$ffff,info);
  18.   if(info.name='')then
  19.   begin
  20.     writeln('No .PAS files found.');
  21.     halt(1);
  22.   end;
  23.   repeat
  24.     de2:=execute(paspth,' '+info.name+' /q /build -$g+ -$r- -$d-');
  25.     write('Compiled ',info.name,'...');
  26.     if(de2=0)then writeln('√')else writeln('%');
  27.     findnext(info);
  28.     de:=doserror;
  29.   until(de<>0);
  30. end.